<?php
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['middleware' => 'auth:api'] , function () {


    Route::get('user', 'UserController@show');
    Route::get('user/list/home', 'UserController@homeList');
    Route::put('user/bind', 'UserController@bind');//绑定手机

    Route::get('user/info/home/{id}', 'UserController@homeInfo');//获取用户详情

    Route::post('user/info', 'UserInfoController@setInfo');

    Route::get('requirement', 'UserRequirementController@show');
    Route::post('requirement', 'UserRequirementController@set');

    Route::post('images','ImageController@index');//图片上传
    Route::post('image/uploads','ImageController@upload');//多图片上传

    Route::post('push/send','PushController@send');//发消息




    Route::get('talk/info','TalkController@info');//聊天记录详情
    Route::get('talk/list','TalkController@list');//聊天记录列表

    //反馈
    Route::post('feedback','FeedBackController@create');//创建反馈
    //分享
    Route::post('share','UserController@share');//创建分享

});

Route::post('mini/decrypt','MiniController@decrypt');//解密
Route::post('mini/tt/decrypt','MiniController@ttDecrypt');//解密
Route::post('test','UserController@test');//测试
Route::get('banner/list', 'BannerController@show');
Route::get('config/select','UserInfoController@selectData');//选项信息

Route::post('smsVerify', 'Auth\LoginController@loginBySMS');
Route::post('smsLogin', 'SMSController@loginCode');                             //通过云片发送登录Code
Route::post('openidLogin', 'Auth\LoginController@loginByOpenid');
Route::post('tt/openidLogin', 'Auth\LoginController@loginByTtOpenid');

Route::get('first/list/home', 'UserController@firstTimeHome');
//Route::get('/auth/password', function (\Illuminate\Http\Request $request){
//    $http = new \GuzzleHttp\Client();
//
//    $response = $http->post('http://www.love.com/oauth/token', [
//        'form_params' => [
//            'grant_type' => 'password',
//            'client_id' => '5',
//            'client_secret' => 'yjzKiqGPBgArwGwFMHpP1MtzcIeAX0Sn8025O4tL',
//            'username' => '12345678',
//            'password' => '12345678',
//            'scope' => '',
//        ],
//    ]);
//
//    return json_decode((string)$response->getBody(), true);
//});
